home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1995 October / EnigmA AMIGA RUN 01 (1995)(G.R. Edizioni)(IT)[!][issue 1995-10][Aminet 7].iso / Aminet / mus / play / tracker_4_31.lzh / tracker / Amiga / amiga.h next >
C/C++ Source or Header  |  1995-01-13  |  3KB  |  142 lines

  1. /* amiga/amiga.h 
  2.     vi:ts=3 sw=3:
  3.  */
  4.  
  5. /* $Id: amiga.h,v 1.16 1995/01/13 13:31:35 espie Exp espie $
  6.  * $Log: amiga.h,v $
  7.  * Revision 1.16  1995/01/13  13:31:35  espie
  8.  * *** empty log message ***
  9.  *
  10.  *
  11.  * Revision 1.15  1994/01/09  04:49:18  Espie
  12.  * File requester !
  13.  * Added pause gadget.
  14.  * Uncentralized event handling using event management functions.
  15.  * Scroller back calls.
  16.  * Fully working asynchronous interface.
  17.  * Problem with output ? Still to fix !
  18.  * new TYPE_SYNC_DO.
  19.  * Protos for obtain_message, send.
  20.  *
  21.  */
  22.  
  23. #define forever for(;;)
  24.  
  25. /* list scanning.
  26.  * next is needed: with it, we can actually unlink the node while scanning
  27.  * the current list.  Type is provided to avoid type-casting errors in
  28.  * SCANLIST expansion.
  29.  */
  30. #define SCANLIST(node, next, list, type) \
  31.    for((node) = (type)((struct MinList *)(list))->mlh_Head; \
  32.       (next) = (type)((struct MinNode *)(node))->mln_Succ; \
  33.       (node) = (next))
  34.  
  35.  
  36. #define PUBLIC_PORT_NAME "Debug this tracker"
  37.  
  38. /* number of messages to allocate */
  39. #define BUFFER_SIZE 500
  40. /* (total size: 500 * 32 = 16000 bytes, corresponding to roughly
  41.  * 1.5 second */
  42.  
  43. struct ext_message
  44.    {
  45.    struct Message msg;
  46. #define TYPE_DIE 0
  47. #define TYPE_WAIT 1
  48. #define TYPE_FLUSH_CHANNEL 2
  49. #define TYPE_SETUP 3
  50. #define TYPE_CHANGE 4
  51. #define TYPE_FLUSH_BUFFER 5
  52. #define TYPE_COMM 6
  53. #define TYPE_SYNC 7
  54. #define TYPE_SYNC_DO 8
  55. #define TYPE_INVALID 9
  56. #define TYPE_PAUSE 10
  57. #define TYPE_UNPAUSE 11
  58.  
  59.    int type;
  60.    union
  61.       {
  62.       struct
  63.          {
  64.          void (*func)(VALUE p);
  65.          VALUE p;
  66.          } hook;
  67.       struct 
  68.          {
  69.          ULONG high;
  70.          ULONG low;
  71.          } time;
  72.       struct
  73.          {
  74.          void *start;
  75.          ULONG length;
  76.          } sample;
  77.       struct
  78.          {
  79.          USHORT channel_mask;
  80.          USHORT cycle;
  81.          USHORT pitch;
  82.          USHORT volume;
  83.          } info;
  84.       struct
  85.          {
  86.          struct MsgPort *port;
  87.          struct Task *task;
  88.          } comm;
  89.       } data;
  90.    };
  91.  
  92.  
  93. /* the audio server entry point */      
  94. XT void subtask P((struct ext_message *msg));
  95.  
  96. /* Standard functions of the client */
  97.  
  98. /* mes = obtain_message():
  99.  *    obtain a message we can send to the server
  100.  *    (this call may block, but usually not for long)
  101.  */
  102. XT struct ext_message *obtain_message P((void));
  103.  
  104. /* mes = await_type(type):
  105.  *    wait for the return of the next message of a given type
  106.  *    and returns it. Synchronization with the server.
  107.  */
  108. XT struct ext_message *await_type P((int type));
  109.  
  110. /* send(msg, type):
  111.  *    send msg to the server, filling type along the way
  112.  */
  113. XT void send P((struct ext_message *msg, int type));
  114.  
  115.  
  116. XT void add_scroller P((char *s));
  117.  
  118. XT struct Screen *obtain_pubscreen(void);
  119.  
  120. XT void set_break(void);
  121. XT void check_events(void);
  122. XT void await_events(void);
  123. XT void install_signal_handler(int signal, void (*f)(GENERIC data), GENERIC data);
  124. XT void remove_signal_handler(int signal);
  125. XT void install_req_handler(ULONG mask, void (*req_f)(ULONG received));
  126. XT void remove_req_handler(void);
  127.  
  128. struct amiganame
  129.    {
  130.    struct MinNode n;
  131.    int i;
  132.    char s[0];  
  133.    };
  134.  
  135. /* prototypes for the file requester */
  136.  
  137. XT void launch_requester P((void));
  138. XT void requested_file P((struct amiganame *name));
  139.  
  140. /* V39 function */
  141. XT void set_busy_pointer P((BOOL maybe));
  142.